package com.heima.user.controller.v1;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.dtos.LoginDto;
import com.heima.user.service.ApUserService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@RequestMapping("api/v1/login")
@RequiredArgsConstructor
public class ApUserLoginController {

    private final ApUserService apUserService;

    /**
     * app端用户登录
     *
     * @param dto
     * @return
     */
    @PostMapping("login_auth")
    public ResponseResult login(@RequestBody LoginDto dto){

        log.info("user login......");

        ResponseResult loginResult = apUserService.login(dto);

        return loginResult;
    }
}
